Dim objShell :Set objShell = CreateObject("Wscript.Shell")
SVNLocation = "C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe"
iBossLocation = "D:\Jacky\iBoss2\main_trunk"
'"D:\Jacky\iBoss2\iBoss2-1.1.20-TSS"
'"D:\Jacky\iBoss2\main_trunk"
'"D:\Jacky\iBoss2\iBoss2-1.1.20-ABCI"
NetBeanMavenLocation = "C:\Users\jackylok\Desktop\RefreshWar\maven\bin\mvn.bat"
MsBuildLocation = "C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe"
ClientBuildMode = Array ("Debug","Release")
ProjectFolders = Array ("iasia-bo-commons","iBoss2Server", "iBoss2Report", "iBoss2JWS", "iBoss2RS")
ClientFolder = "iBossSolution"

updateSVN SVNLocation,iBossLocation,ProjectFolders, ClientFolder
CompileJavaSource iBossLocation,ProjectFolders,NetBeanMavenLocation
CompileClientSource MsBuildLocation, "Debug", iBossLocation, ClientFolder

Function updateSVN( SVNLocation, iBossLocation, ProjectFolders, ClientFolder)
	For Each ProjectFolder in ProjectFolders
		objShell.run (""""+SVNLocation+""" /command:update /path:"""+iBossLocation+"\"+ ProjectFolder +""" /closeonend:1 &exit"), 0, true
	Next
	objShell.run (""""+SVNLocation+""" /command:update /path:"""+iBossLocation+"\"+ ClientFolder +""" /closeonend:1 &exit"), 0, true
End Function

Function CompileJavaSource(iBossLocation, ProjectFolders, NetBeanMavenLocation)
	For Each ProjectFolder in ProjectFolders
		objShell.run ("cmd /K CD /D "+iBossLocation+"\"+ProjectFolder+" &"+" """+NetBeanMavenLocation+""" install &exit" ), 1, true
	Next
End Function

Function CompileClientSource(MsBuildLocation, Mode, iBossLocation, ClientFolder)
	objShell.run (""""+MsBuildLocation+""" /p:Configration= " +Mode+" """+iBossLocation+"\"+ClientFolder+"\iBossSolution.sln""" ), 1, true
	'Wscript.echo """"+MsBuildLocation+""" /p:Configration=" +Mode+" """+iBossLocation+"\"+ClientFolder+"\iBossSolution.sln"""
End Function
'objShell.run ("cmd /K CD /D D:\Jacky\iBoss2\iBoss2-1.1.20-ABCI\iBoss2Server &DeployServerWithAutoRestartTomcat.vbs &exit"), 0, true
'objShell.run ("iboss2ABCI.vbs"), 1, true